package threadpool_1;


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class MyThreadPoolDemo {
    public static void main(String[] args) {

        //1.获取线程池对象
        ExecutorService pool_1 = Executors.newCachedThreadPool();

        //2.提交任务
        pool_1.submit(new MyRunnable());
        pool_1.submit(new MyRunnable());
        pool_1.submit(new MyRunnable());
        pool_1.submit(new MyRunnable());
        pool_1.submit(new MyRunnable());

        //3.销毁线程池
        pool_1.shutdown();
    }
}
